<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../lib/vue-2.4.0.js"></script>
</head>

<body>
  <div id="app">
    <input type="text" v-model="user.id" placeholder="请输入id">
    <input type="text" v-model="user.name" placeholder="请输入name">
    <input type="text" v-model="user.age" placeholder="请输入age">
    <button @click="addUser">添加</button>
    <div v-for="item in userList" :key="item.id">
      <input type="radio" name="user" :value="item.id"> {{item.name}}
    </div>
  </div>
</body>
<script>
  let app = new Vue({
    el: '#app',
    data: {
      userList: [
        {id: 3, name: '张三', age: 23},
        {id: 4, name: '李四', age: 24},
        {id: 5, name: '王五', age: 25},
        {id: 6, name: '赵六', age: 26}
      ],
      user: {}
    },
    methods: {
      addUser() {
        this.userList.unshift(this.user)
      }
    }
  })
</script>

</html>